package com.agile.major.service.impl;

import com.agile.major.domain.ProductionLearningCooperation;
import com.agile.major.repository.ProductionLearningCooperationRepository;
import com.agile.major.service.ProductionLearningCooperationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * Service Implementation for managing ProductionLearningCooperation.
 */
@Service
@Transactional
public class ProductionLearningCooperationServiceImpl implements ProductionLearningCooperationService{

    private final Logger log = LoggerFactory.getLogger(ProductionLearningCooperationServiceImpl.class);

    private final ProductionLearningCooperationRepository productionLearningCooperationRepository;

    public ProductionLearningCooperationServiceImpl(ProductionLearningCooperationRepository productionLearningCooperationRepository) {
        this.productionLearningCooperationRepository = productionLearningCooperationRepository;
    }

    /**
     * Save a productionLearningCooperation.
     *
     * @param productionLearningCooperation the entity to save
     * @return the persisted entity
     */
    @Override
    public ProductionLearningCooperation save(ProductionLearningCooperation productionLearningCooperation) {
        log.debug("Request to save ProductionLearningCooperation : {}", productionLearningCooperation);
        return productionLearningCooperationRepository.save(productionLearningCooperation);
    }

    /**
     *  Get all the productionLearningCooperations.
     *
     *  @param pageable the pagination information
     *  @return the list of entities
     */
    @Override
    @Transactional(readOnly = true)
    public Page<ProductionLearningCooperation> findAll(Pageable pageable) {
        log.debug("Request to get all ProductionLearningCooperations");
        return productionLearningCooperationRepository.findAll(pageable);
    }

    /**
     *  Get one productionLearningCooperation by id.
     *
     *  @param id the id of the entity
     *  @return the entity
     */
    @Override
    @Transactional(readOnly = true)
    public ProductionLearningCooperation findOne(Long id) {
        log.debug("Request to get ProductionLearningCooperation : {}", id);
        return productionLearningCooperationRepository.findOne(id);
    }

    /**
     *  Delete the  productionLearningCooperation by id.
     *
     *  @param id the id of the entity
     */
    @Override
    public void delete(Long id) {
        log.debug("Request to delete ProductionLearningCooperation : {}", id);
        productionLearningCooperationRepository.delete(id);
    }
}
